using System;
using System.Data;
using System.Web; 
using System.Web.UI;
using System.Web.UI.WebControls;

/// <summary>
/// Summary description for GridViewHelper
/// </summary>
public partial class ControlHelper
{
    public void FillDataTableToGridView(
    GridView gridView)
    {
         
         
        DataTable dataTable = 
        sqlServerProvider.GetDataTable( );
        if (dataTable != null)
        {
            gridView.DataSource = dataTable;
        }
        else
            gridView.DataSource = null;
        gridView.DataBind();
    }
    
    public void FillDataTableToGridView(
    GridView gridView, int pageSize,
    int pageCount, PagerButtons pagerButtons )
    {

        gridView.AllowPaging = true;
        DataTable dataTable =
        sqlServerProvider.GetDataTable( );
        if (dataTable != null)
        {
            gridView.DataSource = dataTable;
            gridView.PageSize = pageSize;
            gridView.PagerSettings.PageButtonCount= pageCount;
            gridView.PagerSettings.Mode = pagerButtons;
        }
        else
            gridView.DataSource = null;
        gridView.DataBind();
    }
}
